package com.mzy.linear_struct.hot100.二叉树;

/**
 * @Author: mizy3
 * @Date: 2024/08/20/下午8:03
 * @Description:
 */
public class Pro226翻转二叉树 {

    public TreeNode invertTree(TreeNode root) {
        if (root == null) {
            return null;
        }

        TreeNode left = root.left;
        root.left = root.right;
        root.right = left;

        invertTree(root.left);
        invertTree(root.right);

        return root;
    }

}



























